import * as DICT from '@/constants/dict.js'

export const dictUtils = {
  // 获取 字典列表
  getDict(name) {
    return DICT[name] || []
  },
  // 获取 标签
  getLabel(name, value) {
    const dict = DICT[name] || []
    const item = dict.find(item => item.value === value)
    return item ? item.label : '_'
  }
}

export default dictUtils